package com.example.lvsuo.service.impl;

import com.example.lvsuo.entity.vo.FyVo;
import com.example.lvsuo.service.IFyService;
import com.example.lvsuo.entity.Fy;
import com.example.lvsuo.mapper.FyMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 心心念念
 * @since 2021-03-30
 */
@Service
@Transactional
public class FyServiceImpl extends ServiceImpl<FyMapper, Fy> implements IFyService {

    @Autowired
    FyMapper fm;

    @Override
    public PageInfo queryFy(FyVo f) {
        if(f.getPageNum()==null){
            f.setPageNum(1);
        }
        if(f.getPageSize()==null){
            f.setPageSize(5);
        }
        PageHelper.startPage(f.getPageNum(),f.getPageSize());
        return new PageInfo(fm.queryFy(f));
    }
}
